package com.ruoyi.laiqianba.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 渠道/产品计价类型
 */
@Getter
public enum BaseStatusEnum {

    ABLE(1, "可用"),
    UNABLE(0, "不可用"),
    ;

    private Integer value;
    private String name;

    BaseStatusEnum(Integer value, String name){
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(Integer value) {
        for (BaseStatusEnum item : values()) {
            if (ObjectUtil.equals(value, item.getValue())){
                return item.getName();
            }
        }
        return String.valueOf(value);
    }


}
